<?php

namespace Database\Seeders;

use App\Models\TestList;
use Illuminate\Database\Seeder;

class TestListSeed extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $testLists = [
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 13], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 16]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]],
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 14], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 15]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]],
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 15], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 14]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]],
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 16], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 13]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]],
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 13], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 13]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]],
            ['name' => '测试' . rand(1, 100), 'user_id' => 2, 'paper_id' => rand(8, 10), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'order' => 'radio,checkbox', 'status' => rand(0, 1), 'random' => ["radio" => ["1" => ["num" => rand(1, 3), "level" => rand(1, 3), "fraction" => rand(10, 20), "category_id" => 14], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => 14]], "checkbox" => ["1" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)], "2" => ["num" => rand(1, 3), "level" => 1, "fraction" => 10, "category_id" => rand(13, 16)]]], 'fixed' => ['1' => 10, '2' => 20]]
        ];
        foreach ($testLists as $value) {
            TestList::create($value);
        }
    }

}
